class House():
    def __init__(self, type, total_area, fur_list=None):
        if fur_list is None:
            fur_list = []
        self.type = type
        self.total_area = total_area
        self.free_area = 0.8*total_area  # 自己的规定可以改
        self.fur_list = fur_list

    def add_fur(self, x):
        if self.free_area < x.area:
            print('sorry 空间不足')
        else:
            self.fur_list.append(x.name)
            self.free_area -= x.area
            print('把家具放入房子里')

    def __str__(self):
        return '{}{}{}{}'.format(self.type, self.total_area, self.free_area, self.fur_list)


class Fur():
    def __init__(self, name, area):
        self.name = name
        self.area = area


house1 = House('A户型', 56)

# 把家具放入房间  关键谁来做

bad = Fur('床', 4)
chest = Fur("柜子", 2)
table = Fur('桌子', 1.5)

k = House('B', 16)
k.add_fur(bad)
k.add_fur(bad)
k.add_fur(bad)
k.add_fur(bad)
k.add_fur(bad)
k.add_fur(bad)
k.add_fur(bad)
k.add_fur(bad)
print(k)
